Public Class frmNewFolder

    Public WriteOnly Property Pfad() As String
        Set(ByVal value As String)
            Me.txtPfad.Text = value
        End Set
    End Property

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancel.Click
        Me.DialogResult = Windows.Forms.DialogResult.Cancel
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOK.Click
        If check() = True Then
            Me.DialogResult = Windows.Forms.DialogResult.OK
        End If
    End Sub

    Private Sub frmNeuerOrdner_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        txtOrdner.Select()
    End Sub

    Private Function Check() As Boolean
        Dim retB As Boolean = True
        If IsNothing(Me.txtPfad.Text) Then retB = False
        If IsDBNull(Me.txtPfad.Text) Then retB = False
        Return retB
    End Function

    Private Sub txtOrdner_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles txtOrdner.KeyDown
        If e.KeyData = Keys.Enter Then
            If Check() = True Then
                Me.DialogResult = Windows.Forms.DialogResult.OK
            End If
        End If
    End Sub

End Class